<template>
  <div class="order">
    <a-card title="报工详情总汇">
      <a-form class="formHeader">
        <a-row justify="start" :gutter="24">
          <a-col class="formHeader-criteria">
            <a-row :gutter="16">
              <a-col span="8">
                <a-form-item label="模板名称" label-col-flex="80px">
                  <a-input @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <a-col span="8">
                <a-form-item label="审批级数" label-col-flex="80px">
                  <a-input @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <a-col span="8">
                <a-form-item label="创建日期" label-col-flex="80px">
                  <a-date-picker style="width: 100%" />
                </a-form-item>
              </a-col>
              <a-col span="8">
                <a-form-item label="修改日期" label-col-flex="80px">
                  <a-date-picker style="width: 100%" />
                </a-form-item>
              </a-col>
              <a-col span="8">
                <a-form-item label="创建人" label-col-flex="80px">
                  <a-input @keyup.enter="init" />
                </a-form-item>
              </a-col>
            </a-row>
          </a-col>
          <a-col class="formHeader-btn">
            <a-space direction="vertical" :size="20">
              <a-button type="primary" @click="init">
                <template #icon>
                  <icon-search />
                </template>
                <template #default>查询</template>
              </a-button>
              <a-button @click="reset">
                <template #icon>
                  <icon-refresh />
                </template>
                <template #default>重置</template>
              </a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
      <formButtonGroup
        v-model:columns="columns"
        v-model:size="size"
        :config="config"
        :search-bar="searchBar"
        @refresh="init"
        @change-search-bar="changeSearchBar"
      >
        <template #leftboon>
          <a-button type="primary" @click="foundBoom">创建审批模板</a-button>
        </template>
      </formButtonGroup>
      <a-table
        :columns="columns"
        :data="tabelList"
        :pagination="pagination"
        @page-change="handlePageChange"
        @page-size-change="handlePageSizeChange"
      >
      </a-table>
    </a-card>
  </div>
</template>

<script>
import { defineComponent, toRefs } from 'vue';
import importConfig from './auditTemplate';
import formButtonGroup from '@com/formButtonGroup/formButtonGroup.vue';

export default defineComponent({
  name: 'OrderDom',
  components: { formButtonGroup },
  setup() {
    const { base, columns, handlePageChange, handlePageSizeChange, init, foundBoom } = importConfig();
    init();
    return {
      ...toRefs(base),
      columns,
      handlePageChange,
      handlePageSizeChange,

      init,
      foundBoom,
    };
  },
});
</script>

<style lang="less" scoped>
:deep(.arco-card-header) {
  border-bottom: none;
}

:deep(.arco-card-header-title) {
  text-align: left;
}

.order {
  &-queryForm {
    &-criteria {
      flex: 1 1 0;
    }

    &-btn {
      border-left: 1px solid #ddd;
      flex: 0 0 86px;
      text-align: right;
    }
  }

  &-table {
    font-weight: 500;
  }

  &-bomxa {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
  }
}
.formHeader {
  &-criteria {
    flex: 1 1 0;
  }

  &-btn {
    border-left: 1px solid #ddd;
    flex: 0 0 86px;
    text-align: right;
  }
}
</style>
